????????INFO
        ???????CONTACT

        ???????????????????·?′???22??101

        ?綽??13592986386

        jQuery AJAX??????????????????????λ?????? > jQuery AJAX???????????????

        jQuery AJAX???????????????

        ???????2015/3/2 9:34:23

        jQuery AJAX???????????????

        1.???demo.aspx??檔
        2.????????????????demos.aspx.cs????????á?

        using System.Web.Services;
        3.??????????????.
        ?????????????汾???????.net framework 2.0??2.0???2?????? ???????
        [WebMethod] public static string SayHello()     
        { return "Hello Ajax!";     
        }    
        JS????
        ???????
        $(function() {     
            $("#btnOK").click(function() {     
                $.ajax({ //???post???   type: "Post", //?????????????????   url: "Demo.aspx/SayHello",     
                    contentType: "application/json; charset=utf-8",     
                    dataType: "json",     
                    success: function(data) { //???????????data.d???????   alert(data.d);     
                    },     
                    error: function(err) {     
                        alert(err);     
                    }     
                }); //???e??????   return false;     
            });     
        });   
        ???????
        ??????
            <form id="form1" runat="server">
            <div>
                <asp:Button ID="btnOK" runat="server" Text="??????" />
            </div>
            </form>
        ????Ч?????£? 

        3.?в???????????
        ???????
        [WebMethod] public static string GetStr(string str, string str2)     
        { return str + str2;     
        } 
        JS????
        ???????
        $(function() {     
            $("#btnOK").click(function() {     
                $.ajax({     
                    type: "Post",     
                    url: "demo.aspx/GetStr", //???????ε?д?????????str??βε?????,str2???????βε?????   data: "{'str':'????','str2':'XXX'}",     
                    contentType: "application/json; charset=utf-8",     
                    dataType: "json",     
                    success: function(data) { //???????????data.d???????   alert(data.d);     
                    },     
                    error: function(err) {     
                        alert(err);     
                    }     
                }); //???e??????   return false;     
            });     
        });    
        ???????
        ????Ч?????£?

        4.???????鷽??
        ???????

        ???????
        [WebMethod] public static List<string> GetArray()     
        {     
            List<string> li = new List<string>(); for (int i = 0; i < 10; i++)     
                li.Add(i + ""); return li;     
        }    
        ???????

        JS????

        ???????
        $(function() {     
            $("#btnOK").click(function() {     
                $.ajax({     
                    type: "Post",     
                    url: "demo.aspx/GetArray",     
                    contentType: "application/json; charset=utf-8",     
                    dataType: "json",     
                    success: function(data) { //??????????ul   $("#list").html(""); //?????????   $(data.d).each(function() { //????????li????   $("#list").append("<li>" + this + "</li>");     
                        });     
            
                        alert(data.d);     
                    },     
                    error: function(err) {     
                        alert(err);     
                    }     
                }); //???e??????   return false;     
            });     
        }); 
        ???????

        ??????

        ?
        <form id="form1" runat="server">
        <div>
            <asp:Button ID="btnOK" runat="server" Text="??????" />
        </div>
        <ul id="list">
        </ul>
        </form>

        ???н?????

        有码中文AV无码中文,日本婬片在线视频,听筒婷婷色色激情五月,日本成人不卡免费at视频,亚洲综合日韩一区,人妻一区另类综合,女同欧洲亚洲一区二区,亚洲一区二区三区四